home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 22 / 022.d81 / any printer (.txt) < prev    next >
Commodore BASIC  |  2022-08-26  |  5KB  |  203 lines

  1. 1 printchr$(147)chr$(5):poke53281,0:forx=0to5:print:next
  2. 2 printtab(13)"any printer/64"
  3. 3 print:printtab(17)"*1984*":print:printtab(13)"gary v. fields"
  4. 4 forx=0to3000:next
  5. 15 clr:open15,8,15
  6. 16 u$=chr$(145):rt$=chr$(18):ls$="                          "
  7. 17 ro$=chr$(146):wt$=chr$(5):rd$=chr$(28):n$=chr$(0)
  8. 20 poke53280,0
  9. 22 goto 700
  10. 25 printrt$rd$"disk display"wt$
  11. 26 print:close1,8,0:open1,8,0,"$0":a=0:gosub 60
  12. 27 ifd2$<>"ok"thenclose1
  13. 28 get#1,a$,a$
  14. 29 f$="":b=0:get#1,a$,a$
  15. 31 ifa$=""thenclose1:printrt$"    end directory   "wt$
  16. 32 ifa$=""then forx=0to14-a:printls$:nextx:gosub50:return
  17. 34 get#1,a$
  18. 35 ifa$=""thena=a+1:goto40
  19. 36 ifa$=chr$(34)thenb=1:a$=""
  20. 37 ifb=1thenf$=f$+a$
  21. 38 iflen(f$)>19thenprintf$:goto29
  22. 39 goto34
  23. 40 ifa<14then29
  24. 41 printrt$" file found?  (y/n) "wt$:poke198,0
  25. 42 getq$:ifq$=""then42
  26. 43 printu$u$:printls$
  27. 44 ifq$="y"thena$="":goto31
  28. 45 printu$u$:printls$chr$(19):print:print:print:a=0:goto29
  29. 50 printchr$(19):forx=0to17:print:next:return
  30. 60 input#15,d1,d2$,d3,d4:return
  31. 200 ifa=32thena$=" ":return
  32. 201 ifa=17thena$="[crsr d]":return
  33. 202 ifa=29thena$="[crsr r]":return
  34. 203 ifa=145thena$="[crsr u]":return
  35. 204 ifa=147thena$="[clr/home]":return
  36. 205 ifa=157thena$="[crsr l]":return
  37. 206 ifa=19thena$="[home]":return
  38. 207 ifft$="s"anda=13thenprint#1:return
  39. 208 ifa=13thena$="[return]":return
  40. 209 ifa=14thena$="[lower case]":return
  41. 210 ifa=5thena$="[white]":return
  42. 211 ifa=18thena$="[rev on]":return
  43. 212 ifa=20thena$="[del]":return
  44. 213 ifa=28thena$="[red]":return
  45. 214 ifa=30thena$="[green]":return
  46. 215 ifa=31thena$="[blue]":return
  47. 216 ifa=141thena$="[shft return]":return
  48. 217 ifa=142thena$="[upper case]":return
  49. 218 ifa=144thena$="[black]":return
  50. 219 ifa=146thena$="[rev off]":return
  51. 220 ifa=148thena$="[inst]":return
  52. 221 ifa=156thena$="[pur]":return
  53. 222 ifa=158thena$="[yel]":return
  54. 223 ifa=159thena$="[cyn]":return
  55. 224 ifa=255thena$="[pi]":return
  56. 225 ifa=133thena$="[f1]":return
  57. 226 ifa=134thena$="[f3]":return
  58. 227 ifa=135thena$="[f5]":return
  59. 228 ifa=136thena$="[f7]":return
  60. 229 ifa=137thena$="[f2]":return
  61. 230 ifa=138thena$="[f4]":return
  62. 231 ifa=139thena$="[f6]":return
  63. 232 ifa=140thena$="[f8]":return
  64. 233 ifa=160thena$=" ":return
  65. 234 ifa=151thena$="[grey 1]":return
  66. 235 ifa=152thena$="[grey 2]":return
  67. 236 ifa=155thena$="[grey 3]":return
  68. 237 ifa=129thena$="[orange]":return
  69. 238 ifa=150thena$="[lt red]":return
  70. 239 ifa=153thena$="[lt green]":return
  71. 240 ifa=154thena$="[lt blue]":return
  72. 241 ifa=149thena$="[brown]":return
  73. 250 x$=str$(a):x$=mid$(x$,2,3):a$="[chr$("+x$+")]":return
  74. 300 ifa=153thena$="print":return
  75. 301 ifa=151thena$="poke":return
  76. 302 ifa=152thena$="print#":return
  77. 303 ifa=129thena$="for":return
  78. 304 ifa=131thena$="data":return
  79. 305 ifa=137thena$="goto":return
  80. 306 ifa=139thena$="if":return
  81. 307 ifa=141thena$="gosub":return
  82. 308 ifa=142thena$="return":return
  83. 309 ifa=163thena$="tab(":return
  84. 310 ifa=164thena$="to":return
  85. 311 ifa=175thena$="and":return
  86. 312 ifa=176thena$="or":return
  87. 313 ifa=199thena$="chr$":return
  88. 314 ifa=140thena$="restore":return
  89. 315 ifa=170thena$="+":return
  90. 316 ifa=171thena$="-":return
  91. 317 ifa=172thena$="*":return
  92. 318 ifa=173thena$="/":return
  93. 319 ifa=174thena$="^":return
  94. 320 ifa=177thena$=">":return
  95. 321 ifa=178thena$="=":return
  96. 322 ifa=179thena$="<":return
  97. 323 ifa=194thena$="peek":return
  98. 324 ifa=167thena$="then":return
  99. 325 ifa=133thena$="input":return
  100. 326 ifa=132thena$="input#":return
  101. 327 ifa=143thena$="rem":return
  102. 328 ifa=159thena$="open":return
  103. 329 ifa=160thena$="close":return
  104. 330 ifa=169thena$="step":return
  105. 331 ifa=201thena$="right$":return
  106. 332 ifa=147thena$="load":return
  107. 333 ifa=203thena$="go":return
  108. 340 ifa=128thena$="end":return
  109. 341 ifa=130thena$="next":return
  110. 342 ifa=134thena$="dim":return
  111. 343 ifa=135thena$="read":return
  112. 345 ifa=138thena$="run":return
  113. 346 ifa=144thena$="stop":return
  114. 347 ifa=145thena$="on":return
  115. 348 ifa=148thena$="save":return
  116. 349 ifa=149thena$="verify":return
  117. 350 ifa=150thena$="def":return
  118. 351 ifa=154thena$="cont":return
  119. 352 ifa=155thena$="list":return
  120. 353 ifa=156thena$="clr":return
  121. 354 ifa=157thena$="cmd":return
  122. 355 ifa=197thena$="val":return
  123. 356 ifa=161thena$="get":return
  124. 357 ifa=165thena$="fn":return
  125. 358 ifa=166thena$="spc(":return
  126. 359 ifa=168thena$="not":return
  127. 360 ifa=180thena$="sgn":return
  128. 361 ifa=181thena$="int":return
  129. 362 ifa=182thena$="abs":return
  130. 363 ifa=183thena$="usr":return
  131. 364 ifa=184thena$="fre":return
  132. 365 ifa=185thena$="pos":return
  133. 366 ifa=186thena$="sqr":return
  134. 367 ifa=187thena$="rnd":return
  135. 368 ifa=188thena$="log":return
  136. 369 ifa=189thena$="exp":return
  137. 370 ifa=190thena$="cos":return
  138. 371 ifa=191thena$="sin":return
  139. 372 ifa=192thena$="tan":return
  140. 373 ifa=193thena$="atn":return
  141. 374 ifa=195thena$="len":return
  142. 375 ifa=196thena$="str$":return
  143. 376 ifa=158thena$="sys":return
  144. 377 ifa=198thena$="asc":return
  145. 378 ifa=200thena$="left$":return
  146. 379 ifa=202thena$="mid$":return
  147. 380 ifa=146thena$="wait":return
  148. 381 ifa=162thena$="new":return
  149. 382 ifa=136thena$="let":return
  150. 383 ifa=255thena$="[pi]":return
  151. 390 x$=str$(a):x$=mid$(x$,2,3):a$="chr$("+x$+")":return
  152. 700 printchr$(147):print:print:print
  153. 710 print:print
  154. 720 dd$="":input"view the disk direcory (y/n)";dd$
  155. 722 ifdd$="y"thenprintchr$(147):gosub25:a=0
  156. 730 nf$="":input"name file";nf$
  157. 732 iflen(nf$)<1orlen(nf$)>16thenprintu$u$:goto730
  158. 740 ft$="":print"file type: "rt$"p"ro$"rg or "rt$"s"ro$"eq";:inputft$
  159. 742 ifft$<>"p"thenifft$<>"s"thenprintu$u$:goto740
  160. 750 fd$="":print"print to "rt$"s"ro$"creen or "rt$"p"ro$"rinter";:inputfd$
  161. 752 iffd$<>"s"theniffd$<>"p"thenprintu$u$:goto750
  162. 754 iffd$="s"thenfd=3
  163. 756 iffd$="p"thenfd=4
  164. 760 sk=0:print"# bytes to skip "rt$"<return>"ro$" = none":inputsk
  165. 800 printchr$(147):forx=0to4:print
  166. 810 printrt$" searching for:  "nf$" ,"ft$
  167. 830 iffd=3thenty$="screen"
  168. 835 iffd=4thenty$="printer"
  169. 840 printtab(3)"display on: "ty$
  170. 845 printtab(5)rt$" < f1 to abort> "
  171. 850 close8:open8,8,8,"0:"+nf$+","+ft$+",r"
  172. 852 ifsk>0thenforx=0tosk:get#8,a$:next:x=0
  173. 855 close1:open1,fd
  174. 856 print#1,nf$
  175. 860 gosub60:ifa>0thenprintchr$(147)d1;d2$,d3;d4:goto1000
  176. 865 ifft$="p"thenget#8,a$,b$
  177. 870 ifft$="p"thenget#8,a$,b$
  178. 874 ifft$="s"then905
  179. 875 get#8,c$,d$:f1=asc(c$+n$):f2=asc(d$+n$)
  180. 880 ifst=0thenprint#1,(f2*256)+f1;
  181. 890 get#8,a$:a=asc(a$+n$):ifa>0thenc=0
  182. 891 getbk$:ifbk$=chr$(133)thengoto1000
  183. 892 ifa=0thenfl=0:print#1:c=c+1:goto870
  184. 893 ifst=0then900
  185. 895 ifst=64then1000
  186. 896 print"status: "st:goto1000
  187. 900 iffl=0anda=34thenfl=1:goto905
  188. 901 iffl=1anda>93thengosub200:goto910
  189. 902 ifa=34 thenfl=0
  190. 903 ifa<33thengosub200:goto910
  191. 904 ifa>93thengosub300:goto910
  192. 905 print#1,chr$(a);:a=0:goto890
  193. 910 print#1,a$;:goto890
  194. 1000 print#1:gosub60
  195. 1001 printchr$(5):close1:close8:close15
  196. 1010 ifd1>0thenprint"error-"
  197. 1011 print"disk status:"d1;d2$,d3;d4
  198. 1015 print:print" 1. ==> try again":print" 2. ==> return to loadstar"
  199. 1017 print"which ?"
  200. 1020 poke198,0:wait198,1:getq$:ifq$<>"1"andq$<>"2"then1020
  201. 1030 ifq$="1"thenclr:goto15
  202. 1040 load"hello connect",8
  203.